package com.okwanshiwu.controller;

import com.okwanshiwu.service.interfaces.Pay;
import com.okwanshiwu.util.TipCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 目前是测试使用
 * 用户管理相关的api
 * 登录 注册  修改个人信息等
 * @author  masetyuan
 * @time 20170725
 */
@RestController
@RequestMapping("/app")
public class AppUser extends BaseController{

	@Autowired
	private Pay pay;


	/**
	 * 获取订单号
	 * @return
	 */
	@RequestMapping(value="/createOrderId",method = RequestMethod.POST)
	public String createOrderId(String payType,String userId,String orderType,Integer price,String content,Map other){
		String orderId = pay.createOrderInfo(payType,userId,orderType,price,content,other);
		TipCode tc = new TipCode(1001,"订单号生成成功！");
		tc.putData("data",orderId);
		return tc.toJson();
	}

    
}
